The invention relates to a device for the compression of a fluid, particularly for the pressure filling of a container, of the type comprising a motor, a piston adapted to be displaced linearly in a pump body, transmission means between the motor and the piston adapted to convert the rotary motion generated by the motor into a reciprocating translatory motion by the piston, speed varying means adapted to impart a different speed to the piston of the compressor according to the resistance opposing the motor during one complete admission/compression cycle, these speed varying means comprising a cam driven in rotation by the shaft of the motor and acting via its periphery on a roller connected to the piston, elastic means being provided to hold the roller against the cam, the whole assembly being such that the resisting torque is substantially constant.